<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
SecurityContext (jersey-bundle 1.9 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="SecurityContext (jersey-bundle 1.9 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SecurityContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/ws/rs/core/Response.StatusType.html" title="interface in javax.ws.rs.core"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/ws/rs/core/StreamingOutput.html" title="interface in javax.ws.rs.core"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?javax/ws/rs/core/SecurityContext.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SecurityContext.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.ws.rs.core</FONT>
<BR>
Interface SecurityContext</H2>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../com/sun/jersey/api/core/HttpRequestContext.html" title="interface in com.sun.jersey.api.core">HttpRequestContext</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../com/sun/jersey/spi/container/AdaptingContainerRequest.html" title="class in com.sun.jersey.spi.container">AdaptingContainerRequest</A>, <A HREF="../../../../com/sun/jersey/spi/container/CachedEntityContainerRequest.html" title="class in com.sun.jersey.spi.container">CachedEntityContainerRequest</A>, <A HREF="../../../../com/sun/jersey/spi/container/ContainerRequest.html" title="class in com.sun.jersey.spi.container">ContainerRequest</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>SecurityContext</B></DL>
</PRE>

<P>
An injectable interface that provides access to security related
 information.
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../javax/ws/rs/core/Context.html" title="annotation in javax.ws.rs.core"><CODE>Context</CODE></A></DL>
<HR>

<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#BASIC_AUTH">BASIC_AUTH</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String identifier for Basic authentication.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#CLIENT_CERT_AUTH">CLIENT_CERT_AUTH</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String identifier for Client Certificate authentication.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#DIGEST_AUTH">DIGEST_AUTH</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String identifier for Digest authentication.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#FORM_AUTH">FORM_AUTH</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String identifier for Form authentication.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#getAuthenticationScheme()">getAuthenticationScheme</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the string value of the authentication scheme used to protect 
 the resource.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.security.Principal</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#getUserPrincipal()">getUserPrincipal</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>java.security.Principal</code> object containing the 
 name of the current authenticated user.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#isSecure()">isSecure</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a boolean indicating whether this request was made 
 using a secure channel, such as HTTPS.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/ws/rs/core/SecurityContext.html#isUserInRole(java.lang.String)">isUserInRole</A></B>(java.lang.String&nbsp;role)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a boolean indicating whether the authenticated user is included 
 in the specified logical "role".</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="BASIC_AUTH"><!-- --></A><H3>
BASIC_AUTH</H3>
<PRE>
static final java.lang.String <B>BASIC_AUTH</B></PRE>
<DL>
<DD>String identifier for Basic authentication. Value "BASIC"
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#javax.ws.rs.core.SecurityContext.BASIC_AUTH">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="CLIENT_CERT_AUTH"><!-- --></A><H3>
CLIENT_CERT_AUTH</H3>
<PRE>
static final java.lang.String <B>CLIENT_CERT_AUTH</B></PRE>
<DL>
<DD>String identifier for Client Certificate authentication. Value "CLIENT_CERT"
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#javax.ws.rs.core.SecurityContext.CLIENT_CERT_AUTH">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="DIGEST_AUTH"><!-- --></A><H3>
DIGEST_AUTH</H3>
<PRE>
static final java.lang.String <B>DIGEST_AUTH</B></PRE>
<DL>
<DD>String identifier for Digest authentication. Value "DIGEST"
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#javax.ws.rs.core.SecurityContext.DIGEST_AUTH">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="FORM_AUTH"><!-- --></A><H3>
FORM_AUTH</H3>
<PRE>
static final java.lang.String <B>FORM_AUTH</B></PRE>
<DL>
<DD>String identifier for Form authentication. Value "FORM"
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#javax.ws.rs.core.SecurityContext.FORM_AUTH">Constant Field Values</A></DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getUserPrincipal()"><!-- --></A><H3>
getUserPrincipal</H3>
<PRE>
java.security.Principal <B>getUserPrincipal</B>()</PRE>
<DL>
<DD>Returns a <code>java.security.Principal</code> object containing the 
 name of the current authenticated user. If the user 
 has not been authenticated, the method returns null.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>a <code>java.security.Principal</code> containing the name
 of the user making this request; null if the user has not been 
 authenticated
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if called outside the scope of a request</DL>
</DD>
</DL>
<HR>

<A NAME="isUserInRole(java.lang.String)"><!-- --></A><H3>
isUserInRole</H3>
<PRE>
boolean <B>isUserInRole</B>(java.lang.String&nbsp;role)</PRE>
<DL>
<DD>Returns a boolean indicating whether the authenticated user is included 
 in the specified logical "role". If the user has not been authenticated,
 the method returns <code>false</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>role</CODE> - a <code>String</code> specifying the name of the role
<DT><B>Returns:</B><DD>a <code>boolean</code> indicating whether the user making 
 the request belongs to a given role; <code>false</code> if the user
 has not been authenticated
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if called outside the scope of a request</DL>
</DD>
</DL>
<HR>

<A NAME="isSecure()"><!-- --></A><H3>
isSecure</H3>
<PRE>
boolean <B>isSecure</B>()</PRE>
<DL>
<DD>Returns a boolean indicating whether this request was made 
 using a secure channel, such as HTTPS.
<P>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the request was made using a secure 
 channel, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if called outside the scope of a request</DL>
</DD>
</DL>
<HR>

<A NAME="getAuthenticationScheme()"><!-- --></A><H3>
getAuthenticationScheme</H3>
<PRE>
java.lang.String <B>getAuthenticationScheme</B>()</PRE>
<DL>
<DD>Returns the string value of the authentication scheme used to protect 
 the resource. If the resource is not authenticated, null is returned.
 
 Values are the same as the CGI variable AUTH_TYPE
<P>
<DD><DL>

<DT><B>Returns:</B><DD>one of the static members BASIC_AUTH, FORM_AUTH, 
 CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) or the 
 container-specific string indicating the authentication scheme, 
 or null if the request was not authenticated.
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if called outside the scope of a request</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SecurityContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/ws/rs/core/Response.StatusType.html" title="interface in javax.ws.rs.core"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/ws/rs/core/StreamingOutput.html" title="interface in javax.ws.rs.core"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?javax/ws/rs/core/SecurityContext.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SecurityContext.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2011 <a href="http://www.oracle.com/">Oracle Corporation</a>. All Rights Reserved.
</BODY>
</HTML>
